import org.junit.Test;

import java.awt.*;
import java.awt.event.KeyEvent;

public class StartNacosOneKey {

    public void pressAndRelease(int keyEvent) throws AWTException {
        Robot robot = new Robot();
        robot.keyPress(keyEvent);
        robot.keyRelease(keyEvent);

    }

    @Test
    public void testnacos() throws AWTException, InterruptedException {
        Robot robot = new Robot();
        robot.keyPress(KeyEvent.VK_WINDOWS);
        robot.keyPress(KeyEvent.VK_R);
        robot.keyRelease(KeyEvent.VK_WINDOWS);
        robot.keyRelease(KeyEvent.VK_R);


        robot.delay(1000);
        robot.keyPress(KeyEvent.VK_C);
        robot.keyRelease(KeyEvent.VK_C);

        robot.keyPress(KeyEvent.VK_M);
        robot.keyRelease(KeyEvent.VK_M);

        robot.keyPress(KeyEvent.VK_D);
        robot.keyRelease(KeyEvent.VK_D);

        robot.delay(1000);
        robot.keyPress(KeyEvent.VK_ENTER);
        robot.keyRelease(KeyEvent.VK_ENTER);
        System.out.println("shuruenter");

        robot.delay(1000);
        robot.keyPress(KeyEvent.VK_E);
        robot.keyRelease(KeyEvent.VK_E);

        robot.keyPress(KeyEvent.VK_SHIFT);
        robot.keyPress(KeyEvent.VK_SEMICOLON);
        robot.keyRelease(KeyEvent.VK_SHIFT);
        robot.keyRelease(KeyEvent.VK_SEMICOLON);

        robot.keyPress(KeyEvent.VK_ENTER);
        robot.keyRelease(KeyEvent.VK_ENTER);

        robot.delay(1000);
        robot.keyPress(KeyEvent.VK_C);
        robot.keyRelease(KeyEvent.VK_C);

        robot.keyPress(KeyEvent.VK_D);
        robot.keyRelease(KeyEvent.VK_D);

        pressAndRelease(KeyEvent.VK_SPACE);
        pressAndRelease(KeyEvent.VK_N);
        pressAndRelease(KeyEvent.VK_A);
        pressAndRelease(KeyEvent.VK_C);
        pressAndRelease(KeyEvent.VK_O);
        pressAndRelease(KeyEvent.VK_S);
        pressAndRelease(KeyEvent.VK_SLASH);
        pressAndRelease(KeyEvent.VK_N);
        pressAndRelease(KeyEvent.VK_A);
        pressAndRelease(KeyEvent.VK_C);
        pressAndRelease(KeyEvent.VK_O);
        pressAndRelease(KeyEvent.VK_S);
        pressAndRelease(KeyEvent.VK_SLASH);
        pressAndRelease(KeyEvent.VK_B);
        pressAndRelease(KeyEvent.VK_I);
        pressAndRelease(KeyEvent.VK_N);
        pressAndRelease(KeyEvent.VK_ENTER);

        Thread.sleep(1000);
        pressAndRelease(KeyEvent.VK_S);
        pressAndRelease(KeyEvent.VK_T);
        pressAndRelease(KeyEvent.VK_A);
        pressAndRelease(KeyEvent.VK_R);
        pressAndRelease(KeyEvent.VK_T);

        pressAndRelease(KeyEvent.VK_U);
        pressAndRelease(KeyEvent.VK_P);
        pressAndRelease(KeyEvent.VK_PERIOD);
        pressAndRelease(KeyEvent.VK_C);
        pressAndRelease(KeyEvent.VK_M);

        pressAndRelease(KeyEvent.VK_D);
        pressAndRelease(KeyEvent.VK_SPACE);
        pressAndRelease(KeyEvent.VK_MINUS);
        pressAndRelease(KeyEvent.VK_M);
        pressAndRelease(KeyEvent.VK_SPACE);

        pressAndRelease(KeyEvent.VK_S);
        pressAndRelease(KeyEvent.VK_T);
        pressAndRelease(KeyEvent.VK_A);
        pressAndRelease(KeyEvent.VK_N);
        pressAndRelease(KeyEvent.VK_D);
        pressAndRelease(KeyEvent.VK_A);
        pressAndRelease(KeyEvent.VK_L);
        pressAndRelease(KeyEvent.VK_O);
        pressAndRelease(KeyEvent.VK_N);
        pressAndRelease(KeyEvent.VK_E);

        pressAndRelease(KeyEvent.VK_ENTER);
    }

}
